package com.liveinstars.account.business.service;

import com.liveinstars.account.business.domain.bo.User;
import com.liveinstars.account.business.domain.vo.Account;
import com.liveinstars.api.dto.BindInfo;
import com.liveinstars.api.dto.UnifyAppUpdatepwdReq;
import com.liveinstars.api.dto.UpdateUserpwdVO;

/**
 * @author tomsun28
 * @date 22:02 2018/3/7
 */
public interface AccountService {

    /**
     * description TODO
     *
     * @param appId 1
     * @return com.liveinstars.account.business.domain.vo.Account
     */
    Account loadAccount(String appId);
    /**
     * description TODO
     *
     * @param uid 1
     * @return boolean
     */
    boolean isAccountExistByUserName(String uid);
    /**
     * description TODO
     *
     * @param account 1
     * @return boolean
     */
    boolean registerAccount(User account);
    /**
     * description TODO
     *
     * @param appId 1
     * @return java.lang.String
     */
    String loadAccountRole(String appId);


    boolean validAccount(String userName, String password);

    boolean bindSocialAccount(String userName, String type, String unionid, String openid);

    void loginByMobile(String mobile, String code);

    String loginBySocial(String type, String unionid, String openid);

    boolean validToken(String token, Long uid);

    BindInfo loadBindInfo(Integer uid);

    UpdateUserpwdVO updateUserPasswordByUserName(UnifyAppUpdatepwdReq request);

    UpdateUserpwdVO updateUserPasswordByMobile(UnifyAppUpdatepwdReq request);

    boolean validMobileCode(String mobile, String code);

    boolean bindMobile(String userName, String mobile);
}
